<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateUserWithdraw extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('user_withdraw', function (Blueprint $table) {
            $table->integerIncrements('id');
            $table->unsignedInteger('user_id')->default(0)->comment('用户id');
            $table->unsignedInteger('cooperative_id')->default(0)->comment('合作商id');
            $table->unsignedInteger('gold')->default(0)->comment('金币');
            $table->unsignedTinyInteger('status')->default(0)->comment('提现状态：0待确认，1打款中，2已打款，3被驳回');
            $table->unsignedTinyInteger('is_self_merchant')->default(0)->comment('是否自有商户号打款 0:否 1:是');
            $table->unsignedTinyInteger('gold_type')->default(0)->comment('金币类型：1佣金，2平台奖励');
            $table->text('message')->comment('驳回原因');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('user_withdraw');
    }
}
